package com.framework.wz.wutong.Bean;

import com.framework.wz.wutong.utils.AbMd5;
import com.framework.wz.wutong.utils.ConstantUtil;

public class BaseParams<T> {
    private String timestamp;
    private String token;
    private T parameter;

    public BaseParams(){
        timestamp = String.valueOf(System.currentTimeMillis());
        token = createToken();
    }
    /**
     * 生成token
     * md5(key+timestamp)+|+timestamp
     *
     * @return
     */
    private String createToken() {
        return AbMd5.MD5(ConstantUtil.TOKEN_KEY + timestamp).toLowerCase();
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public T getParameter() {
        return parameter;
    }

    public void setParameter(T parameter) {
        this.parameter = parameter;
    }
}
